import { Observable } from 'rxjs';
import { ExtendOverlayRef } from '../../core/overlay/extendOverlayRef';

export type OverlayCallback = (
  overlayRef?: ExtendOverlayRef,
  portal?: any,
  result?: any,
) => (false | void | object) | Promise<false | void | object> | Observable<false | void | object>;

export interface ExtendOverlayConfig {
  backdropBindClose?: boolean;
  internalTriggerClose?: (event) => void;
  clickToCloseStrategy?: boolean | { exclusions?: HTMLElement[] | string; includes?: string[] };
  scrollToCloseStrategy?: boolean | { exclusions: HTMLElement[] | string };
  beforeOpen?: OverlayCallback;
  afterOpen?: OverlayCallback;
  beforeClose?: OverlayCallback;
  afterClose?: OverlayCallback;
}
